#pragma once

#include "fxcc/core/graph/opengl3/Shader.h"
#include "fxcc/core/graph/opengl3/MeshJack.h"
#include "fxcc/core/graph/opengl3/Effect3d.h"
#include "fxcc/core/graph/common/TextLine.h"
#include "fxcc/core/graph/opengl3/font/FontLib.h"
#include "fxcc/core/graph/opengl3/EffectBase.h"

namespace fxcc
{
	namespace graph
	{
		namespace opengl3
		{
			namespace font
			{
				struct FXCC_API  Effect : public fxcc::graph::opengl3::Effect3d
				{
					Effect(const std::string& fragCode = DefaultragCode());

					void Begin();

					void RenderTextLine(const fxcc::graph::common::TextLine& inst);
					
					void End();
					
					void InitRenderDesc();

					std::string m_FragMain;
					
					static std::string DefaultragCode();
					
					static std::wstring UTF8ToWString(const std::string &utf8Str)
					{
						std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
						return converter.from_bytes(utf8Str);
					}
				};
			}
		};
	}
}